package com.责任链模式;

/**
 * 经理
 * @author Fang Ruichuan
 * @date 2022-09-03 13:12
 */
public class Manager implements Ratify {
    @Override
    public Result deal(Chain chain) {
        Request request = chain.request();
        System.out.println("Manager=====>request: " + request.toString());
        if (request.getDays() > 4) {
            // 构建新的Request
            Request newRequest = new Request.Builder().newRequest(request)
                    .managerInfo(request.getName() + "每月的KPI考核还不错，可以批准")
                    .build();
            return chain.proceed(newRequest);
        }
        return new Result(true, "Manager: 早点把事情办完，项目离不开你");
    }
}
